# -*- coding: utf-8 -*-
'''
Created on 2012-2-19
@author: zivee
'''
from django.http import HttpResponse
from django.http import Http404
import datetime
import sys


def home(request):
    paths = ''
    for path in sys.path:
        paths += '<br />' + path
    return HttpResponse(paths)


def hours_ahead(request, offset):
    try:
        offset = int(offset)
    except ValueError:
        raise Http404()
    dt = datetime.datetime.now() + datetime.timedelta(hours=offset)
    html = "In %d hour(s), It's %s" % (offset, dt)
    return HttpResponse(html)
